home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / cmln0886.arc / GXCREF.LTR < prev    next >
Text File  |  1986-05-23  |  5KB  |  101 lines

  1.                                         Image Processing Section
  2.                                         Lab. Math. Biology, DCBD, NCI
  3.                                         National Institutes of Health
  4.                                         Bethesda, Md. 20892
  5.  
  6.                                         May 23, 1986
  7.  
  8.  
  9. Mr. Craig LaGrow, Editor
  10. Computer Language
  11. 131 Townsend Street
  12. San Francisco, CA 94107
  13.  
  14.  
  15. Dear Craig,
  16.  
  17.  
  18. I was glad to see the productivity tools issue. Since we are being
  19. provided with denser memory and more power CPUs, the use of such
  20. tools will become a necessity in constructing larger and more
  21. sophisticated programs with the new hardware.
  22.  
  23. The CREF program by Reppert ("Cross-referencing in C and PASCAL", CL,
  24. June 1986, 49-60) is one such essential tool. However, it needs a
  25. minor modification to give it even greater utility in handling
  26. large programs. Instead of operating on only one input file and
  27. tracking line and page numbers within only that file, let the user
  28. specify a SET of files and then track the triple (file/page#/line#)
  29. for the CREF. Since large programs typically consist of a number of
  30. modules this facility is invaluable in providing an "index" of the
  31. set of modules - especially with several people working on the
  32. different file.
  33.  
  34. I have written a similar cref program with this global extension
  35. called GXCREF (in the SAIL language, "PSAIL: SAIL to C", CL Aug '85
  36. pp39-44, using string processing instead of B-trees as Reppert did).
  37. GXCREF stands for Global eXtended CREF. The "Global" concept meaning
  38. multiple modules comes from the old DEC10/TOPS10 GLOB program which
  39. generates a similar cref for a set of loader input files which are
  40. generated by the macro assembler. The XCREF part comes from XCREF
  41. which was a C cross reference utility similar to Reppert's by Wortman
  42. and Sidebottom in their book 'The C Programming Tutor' by Wortman and
  43. Sidebottom (R.J. Brady Co. 1984). A sample of the CREF output is
  44. given below for several files:
  45.  
  46. {32} declsize          PSGLBV.REQ/2/130  PSGLBV.SAI/2/144  
  47.                         PSDBUG.SAI/10/48  PSSYMT.SAI/7/49  
  48.                         PSCHEK.SAI/4/25 12/54 15/53  PSCVT.SAI/6/228 
  49.                         16/332  PSFSMA.SAI/2/684 5/118 8/52 94 161 
  50.                         184  PSFSMB.SAI/2/483 485 3/569 4/33  
  51.                         PSFSMD.SAI/2/99 198 699 710 3/193 198 301 548  
  52.                         PSLEX.SAI/5/50 57  PSPARSE.SAI/4/69 5/142  
  53.                         PSMAIN.SAI/2/97 
  54. {12} defaultvalue      PSFSMB.SAI/3/6 42 166 569  PSPARSE.SAI/4/42 
  55.                         89 132 198 204 237 257
  56. {15} delim             PSFSMA.SAI/2/23 263 265 268 271 272 273 292 
  57.                         299 307 315
  58.  
  59. GXCREF has some other useful concepts including: builtin support for
  60. several languages (ADA, C, FORTRAN, MODULA2, PASCAL, and SAIL) to
  61. denote the keywords to omit as well as how comments and quoted
  62. strings are to be handled - since tokens within comments or string
  63. constants should be ignored; a count of the number of times each cref
  64. token occurs - which can be used to report only those tokens within a
  65. specified frequency range [minCount:maxCount]; specifying a list of
  66. words in a file (like Reppert) which can be either omitted or used as
  67. the basis for the cref; building an additional sorted list of all the
  68. cref tokens found which can be combined with a switch to NOT generate
  69. the CREF tables and listing.
  70.  
  71. The above additions let us use crefing for a number of other
  72. "programming" jobs. For example, by specifying the occurence
  73. frequency of any tokens to be reported as [1:1] we can find all
  74. "clutter", i.e. variables defined but never used. Crefing can also be
  75. useful for document processing. Find a set of keywords which you wish
  76. to index and then use this set with a second cref to find where in
  77. the document they actually occur. The algorithm would be as follows:
  78.         [1] Generate a wordlist of all words in the document with
  79.             the first CREF pass.
  80.         [2] Edit this list to include ONLY the words you wish to
  81.             index.
  82.         [3] Generate a CREF of the document using the edited wordlist
  83.             as the list of words to restrict the cref. This results in
  84.             pointers to the document of all entries to be manually
  85.             considered for you to index.
  86.  
  87. GXCREF was used extensivly in building PSAIL which could not have
  88. been done without it. The GXCREF SAIL source file is on the CL BBS
  89. for those who might be interested in the concepts of some of the
  90. extensions. These could probably be added to Repperts program without
  91. too much trouble.
  92.  
  93.  
  94.                                 Sincerely,
  95.  
  96.  
  97.  
  98.  
  99.  
  100.                                 Peter F. Lemkin, Ph.D.
  101.